<#include "/admin/common/head.html"/>
			<!-- /section:basics/sidebar -->
			<div class="main-content">
				<div class="main-content-inner">
					<!-- /section:basics/content.breadcrumbs -->
					<div class="page-content">
						<div class="page-header">
							<h1>
								首页
								<small>
									<i class="ace-icon fa fa-angle-double-right"></i>
									订单管理
								</small>
							</h1>
						</div><!-- /.page-header -->

					<div class="row">
						<div id="tabs">
						<ul>
                        	<li>
                            <a href="#tabs-1"  onClick="optQuery('0')"><i class="blue  fa fa-check-circle-o bigger-120"></i> 待处理</a>
                        	</li>

                        	<li>
                            <a href="#tabs-1"  onClick="optQuery('1')"><i class="green ace-icon fa fa-check-circle-o bigger-120"></i> 已处理</a>
                       		 </li>
                        </ul>
                        <div id="tabs-1" class="col-xs-12" style="padding-left: 5px;">
                    	<@p.table id="order" url="/order/getPager" multiselect=false height=250>
                    	<@p.column name="oid" title="订单号" width=100/>
                    	<@p.column name="total" title="总计" />
                    	<@p.column name="date" title="订单日期"/>
                    	<@p.column name="state" title="订单状态"  buttons="orderState"/>
                    	<@p.column name="opt" title="操作"  buttons="displayButtons"/>
                		</@p.table>
                		</div>
                		</div>
            		</div>
					</div><!-- /.page-content -->
				</div>
			</div><!-- /.main-content -->
		<#include "/admin/common/foot.html"/>
		<script type="text/javascript">
		jQuery(function($) {
	    	$( "#tabs" ).tabs();
		});
		var type="1";
		 function displayButtons(cellvalue, options, rowObject){
			 if(rowObject.state==1){
		        return"<a class='green' title=\"处理订单\" href='javascript:optEdit(\""+rowObject.oid+"\")'><i class='ace-icon fa fa-pencil bigger-130'></i></a>&nbsp;&nbsp;";
			 }else{
				 return"<a class='green' title=\"查看订单\" href='javascript:optEdit(\""+rowObject.oid+"\")'><i class='ace-icon fa fa-search-plus bigger-130'></i></a>&nbsp;&nbsp;";
			 }
		 }
		 function optEdit(oid){
			 $.dialog("/order/to_edit?oid="+oid,"处理订单","1000px","600px");
		 }
		 function orderState(cellvalue, options, rowObject){
			 if(cellvalue=="1"){
				return "待处理";
			 }else{
				 return "已处理";
			 }
		 }
		 function query(){
		       optReloadGrid();
		 }
		 function optQuery(ordertype){
			 var postData = getWhere();
		        if(ordertype)type = ordertype;
		        postData.type = type;
		        jQuery("#grid-table-order").jqGrid('setGridParam',{page:1,postData:postData}).trigger("reloadGrid");
		 }
		 </script>